Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-dropcursor

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-dropcursor

Drop cursor plugin for ProseMirror

  • 1.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
549K
decreased by-57.09%
Maintainers
1
Weekly downloads
 
Created

What is prosemirror-dropcursor?

The prosemirror-dropcursor package is a plugin for ProseMirror, a toolkit for building rich-text editors. This plugin adds a drop cursor to the editor, which is a visual indicator that shows where content will be inserted when it is dragged and dropped.

What are prosemirror-dropcursor's main functionalities?

Adding a Drop Cursor

This code sample demonstrates how to add a drop cursor to a ProseMirror editor. The DropCursor plugin is instantiated and added to the editor's state plugins. When content is dragged and dropped into the editor, the drop cursor will indicate the insertion point.

const { DropCursor } = require('prosemirror-dropcursor');
const { EditorState } = require('prosemirror-state');
const { EditorView } = require('prosemirror-view');
const { schema } = require('prosemirror-schema-basic');
const { DOMParser } = require('prosemirror-model');

const dropCursor = new DropCursor();

const state = EditorState.create({
  doc: DOMParser.fromSchema(schema).parse(document.querySelector('#content')),
  plugins: [dropCursor]
});

const view = new EditorView(document.querySelector('#editor'), {
  state
});

Other packages similar to prosemirror-dropcursor

FAQs

Package last updated on 17 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc